package cc.vicp.djx314.starfood.web.dish;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cc.vicp.djx314.starfood.domain.dish.Dish;
import cc.vicp.djx314.starfood.service.dishes.DishByOneService;

@Controller
public class DishByOneInfoShow {
	//~属性=====================================================================
	@Autowired
	private DishByOneService dishByOneService;

	//~方法=====================================================================
	@RequestMapping(value = "/dish/{id}", method = RequestMethod.GET)
	public String dishInfoShow(@PathVariable("id") Integer id, Model model) throws Exception {
		Dish dish = dishByOneService.findDishByOne(id);
		model.addAttribute("dish", dish);
		return "customer/infoshow/dishbyone";
	}

	//~getter和setter=====================================================================
	public void setDishByOneService(DishByOneService dishByOneService) {
		this.dishByOneService = dishByOneService;
	}
}